import { ScreenSpaceEventType, Viewer } from "cesium";
import { createEventHandler, createEventRegister } from "yt-cesium";

const rightEventMap: WeakMap<Viewer, Set<Function>> = new WeakMap();

/**
 * 注册单击事件
 * @param fn
 * @param opt
 */
export const onRightClick = /*#__PURE__*/createEventRegister(rightEventMap);

/**
 * 开启单击事件
 * @param viewer
 */
export const handleRightClickEventByViewer = /*#__PURE__*/createEventHandler(
  rightEventMap,
  ScreenSpaceEventType.RIGHT_CLICK
);